<template>
    <z-paging ref="paging"  refresher-only @onRefresh="onRefresh" v-bind="$attrs">
        <!-- 自定义下拉刷新view -->
        <template #top v-if="$slots.top">
            <slot name="top"></slot>
        </template>
        <slot></slot>
        <template #bottom v-if="$slots.bottom">
            <slot name="bottom"></slot>
        </template>
    </z-paging>
</template>

<script setup>
/**
 * 
 * @author Dufei
 * @description 全局page组件
 * @param {*} props
 * @param {*} emits
 * @example <gl-page @onRefresh="stopPullDown=> stopPullDown()">
 * @event onRefresh 下拉刷新事件, 参数为stopPullDown方法，调用后停止下拉刷新
 * 
 */
import { ref, defineProps } from 'vue'
const emits = defineEmits(['onRefresh'])
const props = defineProps({})
const paging = ref(null)

function complete(){
    paging.value.complete()
}

function onRefresh() {
    emits('onRefresh', complete)
}


</script>

<style lang="scss" scoped></style>